﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for TinTucBUS
/// </summary>
public class TinTucBUS
{
	private TinTucDAO objTinTucDAO;
    public TinTucBUS(string strPath)
    {
        objTinTucDAO = new TinTucDAO(strPath);
    }
    public DataSet SelectTinTucAll()
    {
        DataSet ds;
        try
        {
            ds = objTinTucDAO.SelectTinTucAll();
            return ds;
        }
        catch (System.Exception e)
        {
            throw new Exception(e.Message, e.InnerException);
        }
    }
    public DataSet SelectTinTuc(int id)
    {
        DataSet ds;
        try
        {
            ds = objTinTucDAO.SelectTinTuc(id);
            return ds;
        }
        catch (System.Exception e)
        {
            throw new Exception(e.Message, e.InnerException);
        }
    }

    public DataSet SelectTinTucAll_Summary(int length)
    {
        DataSet ds;
        try
        {
            ds = objTinTucDAO.SelectTinTucAll_Summary(length);
            return ds;
        }
        catch (System.Exception e)
        {
            throw new Exception(e.Message, e.InnerException);
        }
    }

    public Boolean InsertTinTuc(TinTucDTO tt)
    {
        try
        {
            return objTinTucDAO.InsertTinTuc(tt);
        }
        catch (System.Exception e)
        {
            throw new Exception(e.Message, e.InnerException);
        }
    }

    public Boolean UpdateTinTuc(TinTucDTO tt, int type)
    {
        try
        {
            return objTinTucDAO.UpdateTinTuc(tt, type);
        }
        catch (System.Exception e)
        {
            throw new Exception(e.Message, e.InnerException);
        }
    }

    public Boolean DeleteTinTuc(int id)
    {
        try
        {
            return objTinTucDAO.DeleteTinTuc(id);
        }
        catch (System.Exception e)
        {
            return false;
        }
    }
}
